﻿using Npgsql;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace VoteInformationSystem.Models
{
    public static class NpgsqlConnectionProvider
    {
        //TODO: what happens when connection is lost?
        private static readonly string connstring = String.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};",
                                                    "137.250.170.84", "5432", "postgres", "dbprojekt", "Bundestagswahlen");

        public static NpgsqlConnection GetConnection()
        {
            NpgsqlConnection connection = new NpgsqlConnection(connstring);
            connection.Open();
            return connection;
        }        
    }
}